package day2018_lab02.test17;

public class Test17 {
    public static void main(String[] args) {
        int number[] = new int[5];
        number[0] = 9;
        number[1] = 95;
        number[2] = 100;
        number[3] = 99;
        number[4] = 66;
        //求最大值
        int max = number[0];
        int location1=0;
        for (int j = 1; j < number.length; j++) {
            if (number[j] > max) {

                max=number[j];
                location1=j+1;
            }
        }
        System.out.println("位置在："+location1);
        System.out.println(max);

        //求最小值
        int min= number[0];
        for (int i=0;i<number.length;i++){
            if (number[i]<min){
                min= number[i];
            }
        }
        System.out.println("最小值："+min);
        //求位置的方法是什么？
        int sum=0;
        for(int s= 0;s<number.length;s++){
            sum=sum+number[s];
        }
        System.out.println("zongheshi "+sum);
    }
}
